home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1508 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.9 KB  |  43 lines

  1. Path: news.compuserve.com!newsmaster
  2. From: 100754.2730@compuserve.com (Martin Aupperle)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Exception handling Borland C++ 4.53
  5. Date: Thu, 11 Jan 1996 11:53:30 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4d2u23$rul@dub-news-svc-5.compuserve.com>
  8. References: <30E739B6.3294@worldlink.ca>
  9. NNTP-Posting-Host: ad71-132.compuserve.com
  10. X-Newsreader: Forte Free Agent v0.56
  11.  
  12. Norbert HachΘ <patsalou@worldlink.ca> wrote:
  13.  
  14. >I am currently developping a windows application using Borland C++ 4.53. 
  15. >I am using OWL and making extensive usage of exception handling of my 
  16. >own. What I would like to do is to write a central error handler in my 
  17. >OwlMain() function. Unfortunately, event response functions, such as 
  18. >EvLButtonDown() etc are called by the Windows environment, not by a 
  19. >function of my application, so when I throw errors from inside one of 
  20. >these response function, it never makes it to my OwlMain function. Does 
  21. >anyone know a trick that allows to centralise the error handler in only 
  22. >one place (ie I dont want a complete error handler in all my response 
  23. >functions, I think it defeats the purpose of exception handling).
  24.  
  25. I do not use OWL, I use zApp, but this should make no difference for
  26. your problem. 
  27. zApp has a go-routine that user code has to call to start the event
  28. loop. I put this function call in a try block and the following
  29. handler correctly catches all uncaught exceptions from all callback
  30. functions. Please note that this is not guaranteed to work (since
  31. functions not compiled with exception handling enabled may be in the
  32. call chain (e.g. Windows functions) ), but it works fine for zApp,
  33. Windows and X/Motif. 
  34.  
  35. I don't know OWL, but sure there is a function that starts event
  36. processing which you can put in a try-block.
  37.  
  38. Martin
  39. -----------------------------------
  40. Signatures are a waste of bandwidth
  41. -----------------------------------
  42.  
  43.